<div class='container'>
    <div class='weui-cells__title'>卡币充值</div>
    <div class='weui-cells'>
        <div style="padding:50px 0;text-align: center;" onclick="INFO.reload('#user-balance')">
            <h2>
                剩余卡币：
                <span class='bc-info' data-port='http://api.hongyanche.com/user/balance' id='user-balance'><balance info=f></balance></span>
            </h2>
            <br/>
            <small mute>点击刷新卡币</small>
        </div>
    </div>
    <div class='weui-cells'>
        <div class='weui-cell'>
            <div class='weui-cell__hd'>
                <label class='weui-label'>充值数量</label>
            </div>
            <div class='weui-cell__bd'>
                <input class='weui-input' id='user-recharge-total_fee' placeholder="输入数量" type='tel' />
            </div>
        </div>
    </div>
    <div class='weui-btn-area'>
        <a class='weui-btn weui-btn_primary' id='user-recharge-confirm'>确认充值</a>
    </div>
</div>
<script>
    $(function(){
        POST.init("#user-recharge-confirm",{
            url:'/user/recharge_order_create',
            input:function(){
                var total_fee = (parseInt($('#user-recharge-total_fee').val())||0)*100;
                return {total_fee:total_fee};
            },
            success:function(e,res){
                var order_id = res.data.info.order_id;
                if(!order_id){
                    alert('order_id订单号错误');
                }
                PAY.order_id = order_id;
                PAY.body = "账户充值["+(INFO.cache.user.tel||INFO.cache.user.user_name)+"] [未言俱乐部]";
                $(document).trigger('bc-pay-tenpay');
            }
        })
    })
</script>